home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Alde ADA 1: #1
/
CCCC 8804 Volume 1 Number 1 - Alde.iso
/
C
/
MISC
/
LIB
/
DLIBSSRC.ARC
/
MEMCHR.C
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1987-07-15
|
314 b
|
17 lines
#include <stdio.h>
char *memchr(buf, c, cnt)
register char *buf;
register char c;
register int cnt;
/*
* Search the first <cnt> bytes of <buf> for <c>. Returns a pointer to
* the matching character, or NULL if not found.
*/
{
while(cnt--)
if(*buf++ == c)
return(--buf);
return(NULL);
}